package com.lsk.util;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by Administrator on 2017/6/14.
 */
public class ReqClassify {
    public static String ReqType(HttpServletRequest request){
        String type="";
        String userAgent = request.getHeader("user-agent");
        if(userAgent.indexOf("Android") != -1){
            type="0";//安卓
        }else if(userAgent.indexOf("iPhone") != -1 || userAgent.indexOf("iPad") != -1){
            type="1";//苹果
        }else{
            type="2";//电脑
        }
        return type;
    }
}
